package cloudjunit;

import java.util.List;

import com.amazonaws.services.simpleworkflow.flow.annotations.Activities;
import com.amazonaws.services.simpleworkflow.flow.annotations.Activity;
import com.amazonaws.services.simpleworkflow.flow.annotations.ActivityRegistrationOptions;
import com.amazonaws.services.simpleworkflow.flow.annotations.ExponentialRetry;

@Activities
public interface UnitTestActivities
{
    
    @Activity(name = "findUnitTestsInJar", version = "1.4")
    @ActivityRegistrationOptions(defaultTaskScheduleToStartTimeoutSeconds = 2 * 60, defaultTaskStartToCloseTimeoutSeconds = 10 * 60)
    @ExponentialRetry(initialRetryIntervalSeconds = 2, maximumAttempts = 3)
    List<String> findUnitTestsInJar(String workFlowId, String jarFileRemotePath) throws Exception;
    
    
    @Activity(name = "runUnitTestAndUploadResults", version = "1.4")
    @ActivityRegistrationOptions(defaultTaskScheduleToStartTimeoutSeconds = 2 * 60, defaultTaskStartToCloseTimeoutSeconds = 10 * 60)
    @ExponentialRetry(initialRetryIntervalSeconds = 2, maximumAttempts = 3)
    String runUnitTestAndUploadResults(String workFlowId, String jarFileRemotePath, String ResultsFolderRemotePath, String unitTestClassName) throws Exception;
    
    /////////////////////////////
    
    @Activity(name = "initWorkFlowData", version = "1.4")
    @ActivityRegistrationOptions(defaultTaskScheduleToStartTimeoutSeconds = 2 * 60, defaultTaskStartToCloseTimeoutSeconds = 10 * 60)
    void initUnitTestWorkFlowData(String workFlowId);
    
    
    @Activity(name = "finalizeWorkFlowData", version = "1.4")
    @ActivityRegistrationOptions(defaultTaskScheduleToStartTimeoutSeconds = 2 * 60, defaultTaskStartToCloseTimeoutSeconds = 10 * 60)
    void finalizeWorkFlowData(String workFlowId);
} 